package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Enquete generated by hbm2java
 */
@Entity
@Table(name = "Enquete", schema = "dbo", catalog = "CRM")
public class Enquete implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int enqueteId;
	private Client client;
	private Employe employeByEmployeCommercialId;
	private Employe employeByEmployeMetreur;
	private Date dateCreation;
	private Date dateReception;
	private Set<ElementContrat> elementContrats = new HashSet<ElementContrat>(0);
	private Set<FamilleEnquete> familleEnquetes = new HashSet<FamilleEnquete>(0);

	public Enquete() {
	}

	public Enquete(int enqueteId) {
		this.enqueteId = enqueteId;
	}

	public Enquete(int enqueteId, Client client,
			Employe employeByEmployeCommercialId,
			Employe employeByEmployeMetreur, Date dateCreation,
			Date dateReception, Set<ElementContrat> elementContrats, Set<FamilleEnquete> familleEnquetes) {
		this.enqueteId = enqueteId;
		this.client = client;
		this.employeByEmployeCommercialId = employeByEmployeCommercialId;
		this.employeByEmployeMetreur = employeByEmployeMetreur;
		this.dateCreation = dateCreation;
		this.dateReception = dateReception;
		this.elementContrats = elementContrats;
		this.familleEnquetes = familleEnquetes;
	}

	@Id
	@GeneratedValue
	@Column(name = "enqueteId", unique = true, nullable = false)
	public int getEnqueteId() {
		return this.enqueteId;
	}

	public void setEnqueteId(int enqueteId) {
		this.enqueteId = enqueteId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clientId")
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employeCommercialId")
	public Employe getEmployeByEmployeCommercialId() {
		return this.employeByEmployeCommercialId;
	}

	public void setEmployeByEmployeCommercialId(
			Employe employeByEmployeCommercialId) {
		this.employeByEmployeCommercialId = employeByEmployeCommercialId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employeMetreur")
	public Employe getEmployeByEmployeMetreur() {
		return this.employeByEmployeMetreur;
	}

	public void setEmployeByEmployeMetreur(Employe employeByEmployeMetreur) {
		this.employeByEmployeMetreur = employeByEmployeMetreur;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateReception", length = 23)
	public Date getDateReception() {
		return this.dateReception;
	}

	public void setDateReception(Date dateReception) {
		this.dateReception = dateReception;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "ProduitServiceConcernes", schema = "dbo", catalog = "CRM", joinColumns = { @JoinColumn(name = "enqueteId", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "ElementContratId", nullable = false, updatable = false) })
	public Set<ElementContrat> getElementContrats() {
		return this.elementContrats;
	}

	public void setElementContrats(Set<ElementContrat> elementContrats) {
		this.elementContrats = elementContrats;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "enquete")
	public Set<FamilleEnquete> getFamilleEnquetes() {
		return this.familleEnquetes;
	}

	public void setFamilleEnquetes(Set<FamilleEnquete> familleEnquetes) {
		this.familleEnquetes = familleEnquetes;
	}

}
